<?php
namespace Admin\Controller;
class YuyueController extends IsloginController{
    function oper(){
        $yuyue = M("Liangfang");
        $arr = $yuyue->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function update(){
        $yuyue = M("Liangfang");
        $id=$_GET["id"];
        $arr = $yuyue->where("id=$id")->find();
        $this->assign('arr',$arr);
        $this->display();
    }
    function del(){
        $id=$_POST["id"];
        $yuyue = M("Liangfang");
        $re = $yuyue->where("id=$id")->delete();
        if($re){
            echo json_encode(array('msg'=>1));
        }
    }
    function save(){
        $yuyue = M("Liangfang");
        $re = $yuyue->data($_POST)->save();
        if($re){
            $this->success('修改成功！',U('Yuyue/oper'));
        }
    }


}